package com.gzsxy.esjy.response;

/**
 * 默认response
 * @author zhangxiaolong
 * @date 2022/7/6 9:36
 */
public class DefaultResponse extends AbstractResponse{

	private static final  DefaultResponse response = new DefaultResponse((Object)null,0,200,"操作成功");

	public DefaultResponse(Object data, int level, int code, String msg) {
		super(data, level, code, msg);
	}

	public DefaultResponse() {
	}

	public static DefaultResponse ok(){
		return response;
	}

	public static DefaultResponse ok(Object data){
		return new DefaultResponse(data,0,200,"操作成功");
	}

	public static DefaultResponse error(String msg){
		return new DefaultResponse((Object)null,0,500,msg);
	}

	@Override
	public void setData(Object data) {
		super.data = data;
	}

	@Override
	public void setLevel(int level) {
		super.level = level;
	}

	@Override
	public void setCode(int code) {
		super.code = code;
	}

	@Override
	public void setMsg(String msg) {
		super.msg = msg;
	}

}
